package com.pi.tools;



import java.text.SimpleDateFormat;



/**

 * 对接受和发送的数据进行设置

 * 

 * @author Administrator

 * 

 */

public class FormatGpsInfo {



	public static String getLicenseType(int type) {

		String ltype = "";

		switch (type) {

		case 1:

			ltype = "大型汽车号牌";

			break;

		case 2:

			ltype = "小型汽车号牌";

			break;

		case 3:

			ltype = "使馆汽车号牌";

			break;

		case 4:

			ltype = "领馆汽车号牌";

			break;

		case 5:

			ltype = "境外汽车号牌";

			break;

		case 6:

			ltype = "外籍汽车号牌";

			break;

		case 7:

			ltype = "两、三轮摩托车号牌";

			break;

		case 8:

			ltype = "轻便摩托车号牌";

			break;

		case 9:

			ltype = "使馆摩托车号牌";

			break;

		case 10:

			ltype = "领馆摩托车号牌";

			break;

		case 11:

			ltype = "境外摩托车号牌";

			break;

		case 12:

			ltype = "外籍摩托车号牌";

			break;

		case 13:

			ltype = "农用运输车号牌";

			break;

		case 14:

			ltype = "拖拉机号牌";

			break;

		case 15:

			ltype = "挂车号牌";

			break;

		case 16:

			ltype = "教练汽车号牌";

			break;

		case 17:

			ltype = "教练摩托车号牌";

			break;

		case 18:

			ltype = "试验汽车号牌";

			break;

		case 20:

			ltype = "临时入境汽车号牌";

			break;

		case 21:

			ltype = "临时入境摩托车号牌";

			break;

		case 22:

			ltype = "临时行驶车号牌";

			break;

		case 23:

			ltype = "警用汽车号牌";

			break;

		case 24:

			ltype = "警用摩托号牌";

			break;

		case 99:

			ltype = "其他号牌";

			break;

		}

		return ltype;

	}



	public static String getLicensecolor(int type) {

		String ltype = "";

		switch (type) {

		case 1:

			ltype = "蓝色";

			break;

		case 2:

			ltype = "黄色";

			break;

		case 3:

			ltype = "白色";

			break;

		default:

			ltype = "黑色";

		}

		return ltype;

	}



	// GPS方向设置

	public static String getDirection(int angle) {
		angle = angle * 2;
		String direction = "";

		if(angle > 0 && angle < 90) {
			direction = "东偏北" + (90 - angle) + "°";
		}else if (angle > 90 && angle < 180) {
			direction = "东偏南" + (angle - 90) + "°";
		}else if(angle > 180 && angle < 270) {
			direction = "西偏南" + (angle - 180) + "°";
		}else if(angle > 270) {
			direction = "西偏北" + (angle - 270) + "°";
		}else if(angle == 0) {
			   direction = "正北方";
		 }else if(angle == 90) {
			   direction = "正东方";
		 }else if(angle == 180) {
			   direction = "正南方";
		 }else if(angle == 270) {
			   direction = "正西方";
		}else if(angle > 0 && angle < 90) {
			   direction = "北偏东" + (90 - angle) + "°";
		 } 
		return direction;
	}
}





